<form action="" method="post">
    <div class="content-box">
        <div class="body-auto content-info clearfix">
            <p class="content-top-line"></p>
            <div class="content-middle">
                <p class="mb-20"><img src="<?php echo Yii::app()->request->baseUrl; ?>/img/message-tit.png"></p>
                <div class="content-text">
                    <ul class="message-info">
                        <?php if($lang=='en'){ ?>
                            <li class="mb-10">
                                <em>
<!--                                    <i class="col-red">*</i>-->
                                    Message：
                                </em>
                                <textarea id="body"></textarea>
                            </li>
                            <li class="mb-10">
                                <em>Your name：</em>
                                <input type="text" id="name" class="txt1"/>
                            </li>
                            <li class="mb-10">
                                <em>Your e-mail：</em>
                                <input type="text" id="email" class="txt1"/>
                            </li>
                            <li class="mb-10">
                                <em>phone：</em>
                                <input type="text" id="phone" class="txt1"/>
                            </li>
                            <li>
                                <em></em>
                                <button type="button" onclick="base_submit()" >Leave</button>
                            </li>
                        <?php }else{ ?>
                            <li class="mb-10">
                                <em>
<!--                                    <i class="col-red">*</i>-->
                                    留言内容：
                                </em>
                                <textarea id="body"></textarea>
                            </li>
                            <li class="mb-10">
                                <em>您的姓名：</em>
                                <input type="text" id="name" class="txt1"/>
                            </li>
                            <li class="mb-10">
                                <em>您的邮箱：</em>
                                <input type="text" id="email" class="txt1"/>
                            </li>
                            <li class="mb-10">
                                <em>联系电话：</em>
                                <input type="text" id="phone" class="txt1"/>
                            </li>
                            <li>
                                <em></em>
                                <button type="button" onclick="base_submit()">发表留言</button>
                            </li>
                        <?php } ?>

                    </ul>
                </div>
            </div>
            <p class="content-bottom-line"></p>
        </div>
    </div>
</form>

<script type="text/javascript">
    function base_submit(){
        var body=$('#body').val();
        var name=$('#name').val();
        var email=$('#email').val();
        var phone=$('#phone').val();
        <?php if($lang=='en'){ ?>
            if(!email && !phone){ alert('Please fill in the contact information!');return false;}
        <?php }else{ ?>
            if(!email && !phone){ alert('请填写联系方式!'); return false;}
        <?php } ?>

        $.post('<?php echo Yii::app()->request->baseUrl; ?>/message/ajaxMessage',{body:body,name:name,email:email,phone:phone},function(data){
            alert(data.msg);
        })
    }
</script>